#include <hxcpp.h>

#ifndef INCLUDED_JExternalObject
#include <JExternalObject.h>
#endif
#ifndef INCLUDED_JStringBuilder
#include <JStringBuilder.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_StringBuf
#include <StringBuf.h>
#endif
#ifndef INCLUDED_cpp_CppInt32__
#include <cpp/CppInt32__.h>
#endif

Void JStringBuilder_obj::__construct(Dynamic c)
{
{
	HX_SOURCE_POS("Source/JStringBuilder.hx",12)
	this->type = HX_CSTRING("java/lang/StringBuilder");
	HX_SOURCE_POS("Source/JStringBuilder.hx",13)
	this->local = ::StringBuf_obj::__new();
	HX_SOURCE_POS("Source/JStringBuilder.hx",14)
	if ((::Std_obj::is(c,hx::ClassOf< ::cpp::CppInt32__ >()))){
		HX_SOURCE_POS("Source/JStringBuilder.hx",15)
		this->cap = c;
	}
	else{
		HX_SOURCE_POS("Source/JStringBuilder.hx",16)
		if ((::Std_obj::is(c,hx::ClassOf< ::String >()))){
			HX_SOURCE_POS("Source/JStringBuilder.hx",17)
			::StringBuf _this = this->local;
			HX_SOURCE_POS("Source/JStringBuilder.hx",17)
			hx::IndexRef((_this->b).mPtr,_this->b->__Field(HX_CSTRING("length"),true)) = c;
		}
		else{
			HX_SOURCE_POS("Source/JStringBuilder.hx",19)
			hx::Throw (HX_CSTRING("Invalid Type"));
		}
	}
}
;
	return null();
}

JStringBuilder_obj::~JStringBuilder_obj() { }

Dynamic JStringBuilder_obj::__CreateEmpty() { return  new JStringBuilder_obj; }
hx::ObjectPtr< JStringBuilder_obj > JStringBuilder_obj::__new(Dynamic c)
{  hx::ObjectPtr< JStringBuilder_obj > result = new JStringBuilder_obj();
	result->__construct(c);
	return result;}

Dynamic JStringBuilder_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JStringBuilder_obj > result = new JStringBuilder_obj();
	result->__construct(inArgs[0]);
	return result;}

hx::Object *JStringBuilder_obj::__ToInterface(const type_info &inType) {
	if (inType==typeid( ::JExternalObject_obj)) return operator ::JExternalObject_obj *();
	return super::__ToInterface(inType);
}


JStringBuilder_obj::JStringBuilder_obj()
{
}

void JStringBuilder_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JStringBuilder);
	HX_MARK_MEMBER_NAME(type,"type");
	HX_MARK_MEMBER_NAME(local,"local");
	HX_MARK_MEMBER_NAME(cap,"cap");
	HX_MARK_END_CLASS();
}

void JStringBuilder_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(type,"type");
	HX_VISIT_MEMBER_NAME(local,"local");
	HX_VISIT_MEMBER_NAME(cap,"cap");
}

Dynamic JStringBuilder_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"cap") ) { return cap; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"type") ) { return type; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"local") ) { return local; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JStringBuilder_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"cap") ) { cap=inValue.Cast< ::cpp::CppInt32__ >(); return inValue; }
		break;
	case 4:
		if (HX_FIELD_EQ(inName,"type") ) { type=inValue.Cast< ::String >(); return inValue; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"local") ) { local=inValue.Cast< ::StringBuf >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JStringBuilder_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("type"));
	outFields->push(HX_CSTRING("local"));
	outFields->push(HX_CSTRING("cap"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("type"),
	HX_CSTRING("local"),
	HX_CSTRING("cap"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
};

Class JStringBuilder_obj::__mClass;

void JStringBuilder_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("JStringBuilder"), hx::TCanCast< JStringBuilder_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JStringBuilder_obj::__boot()
{
}

